﻿<?xml version="1.0" encoding="utf-8" ?>
<GuidancePackage xmlns="http://schemas.microsoft.com/pag/gax-core"
    Name="StrongNamingGuidancePackage" 
    Caption="Strong Naming Guidance Package"
    Description="Guidance Package that simplifies strong-naming of multiple projects"
    BindingRecipe="BindingRecipe"
    Guid="2d4b99e7-3126-4452-8882-edfd826ea78a" 
    SchemaVersion="1.0">
  <Overview Url="Documentation\SNGPOverview.htm" />
  <Recipes>
    <Recipe Name="BindingRecipe">
      <Types>
        <TypeAlias Name="RefCreator" Type="Microsoft.Practices.RecipeFramework.Library.Actions.CreateUnboundReferenceAction, Microsoft.Practices.RecipeFramework.Library"/>
      </Types>
      <Caption>Creates unbound references to the guidance package</Caption>
      <Actions>
        <Action Name="StrongName" Type="RefCreator" AssetName="StrongNameSolution" 
                ReferenceType="Microsoft.Practices.EnterpriseLibrary.StrongNamingGuidancePackage.References.SolutionFolderRecipeReference, Microsoft.Practices.EnterpriseLibrary.StrongNamingGuidancePackage" />
        <Action Name="CreateKeyPairReference" Type="RefCreator" AssetName="CreateKeyPair" 
                ReferenceType="Microsoft.Practices.EnterpriseLibrary.StrongNamingGuidancePackage.References.ProjectRecipeReference, Microsoft.Practices.EnterpriseLibrary.StrongNamingGuidancePackage" />
      </Actions>
    </Recipe>
    <Recipe Name="CreateKeyPair" Bound="false">
      <Caption>Create a new strong-name key pair file</Caption>
      <HostData>
        <CommandBar Name="Project"/>
        <CommandBar Name="Solution Folder"/>
      </HostData>
      <Arguments>
        <Argument Name="CurrentProject" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
          <ValueProvider Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.FirstSelectedProject, Microsoft.Practices.RecipeFramework.Library" />
        </Argument>
        <Argument Name="KeyPairFile" />
      </Arguments>
      <GatheringServiceData>
        <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
          <Pages>
            <Page>
              <Title>Create Key Pair for Strong-Naming</Title>
              <LinkTitle>Key Information</LinkTitle>
              <Fields>
                <Field ValueName="KeyPairFile" Label="Key Pair File">

                </Field>
              </Fields>
            </Page>
          </Pages>
        </Wizard>
      </GatheringServiceData>
      <Actions>
        <Action Name="CreateKeyPairAction" 
								Type="Microsoft.Practices.EnterpriseLibrary.StrongNamingGuidancePackage.Actions.CreateKeyPairAction, Microsoft.Practices.EnterpriseLibrary.StrongNamingGuidancePackage"
								KeyFilenameSuffix=".snk"
								>
          <Input Name="ContainerProject" RecipeArgument="CurrentProject" />
          <Input Name="KeyPairFile" RecipeArgument="KeyPairFile" />
        </Action>
      </Actions>
    </Recipe>
    <Recipe Name="StrongNameSolution" Bound="false" Recurrent="true">
      <Caption>Strong-name all projects in this solution or solution folder</Caption>
      <HostData>
        <CommandBar Name="Solution"/>
        <CommandBar Name ="Solution Folder"/>
      </HostData>
      <Arguments>
				<Argument Name="CurrentProject" Required="false" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
					<ValueProvider Type="Microsoft.Practices.EnterpriseLibrary.StrongNamingGuidancePackage.ValueProviders.FirstSelectedProject, Microsoft.Practices.EnterpriseLibrary.StrongNamingGuidancePackage" />
				</Argument>
				<Argument Name="CurrentSolution" Type="EnvDTE.Solution, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
					<ValueProvider Type="Microsoft.Practices.EnterpriseLibrary.StrongNamingGuidancePackage.ValueProviders.SolutionValueProvider, Microsoft.Practices.EnterpriseLibrary.StrongNamingGuidancePackage" />
				</Argument>
				<Argument Name="KeyPairFile" Required="true" Type="System.String"/>
        <Argument Name="UpdateInternalsVisibleTo" Required="true" Type="System.Boolean"/>
			</Arguments>
      <GatheringServiceData>
        <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
          <Pages>
            <Page>
              <Title>Strong-Name Projects in Solution</Title>
							<LinkTitle>Key and Project Information</LinkTitle>
              <Fields>
                <Field ValueName="KeyPairFile" Label="Key Pair File">
                  <Editor Type="Microsoft.Practices.EnterpriseLibrary.StrongNamingGuidancePackage.Editors.FileChooser, Microsoft.Practices.EnterpriseLibrary.StrongNamingGuidancePackage" 
													Title="Please choose a file"
													Filter="All Key Files (*.snk)|*.snk"
													InitialDirectoryExpression="$CurrentSolution.FileName$"
													/>
                </Field>
                <Field ValueName="UpdateInternalsVisibleTo" Label="Update InternalsVisibleTo"></Field>
              </Fields>
            </Page>
          </Pages>
        </Wizard>
      </GatheringServiceData>
      <Actions>
        <Action Name="StrongNameProjects" Type="Microsoft.Practices.EnterpriseLibrary.StrongNamingGuidancePackage.Actions.StrongNameProjectsAction, Microsoft.Practices.EnterpriseLibrary.StrongNamingGuidancePackage">
          <Input Name="ContainerProject" RecipeArgument="CurrentProject" />
          <Input Name="KeyPairFile" RecipeArgument="KeyPairFile" />
          <Input Name="UpdateInternalsVisibleTo" RecipeArgument="UpdateInternalsVisibleTo"/>
        </Action>
      </Actions>
    </Recipe>
  </Recipes>
</GuidancePackage>
